home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
manage
/
bconfg.arc
/
BCONFIG.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-11-17
|
29KB
|
796 lines
Program BConfig; {version 1.2}
{.$Define Quiet}
{.$Define UseSysReq} {remove the dot to make Sys Req the hotkey}
uses TPCRT, {Turbo Professional Routines}
TPDOS, { " " " }
TPEnhKbd, { " " " }
TPString, { " " " }
TPWindow; { " " " }
Type
Str80 = String[80];
StrikeMode = (Single,Double,Animate);
SmallArray = Array[1..255] of byte;
Const
TopRow : byte = 3;
LeftCol : byte = 55;
Factor : Word = ($ffff div 99); {conversion factor for speed}
SysString : String[22] = '<Sys Req> to activate$';
NoSysString : String[22] = '<Ctrl+Alt+Left Shift> ';
Arrows : String[4] = ^[^Z' ';
OldMenu : Array[1..9] of string[21]= (
' Wake up ',
' Window position ',
' Window size ',
' Double Strike ',
' Unhook BDEBUG ',
' Exit this menu (ESC)',
'═════════════════════',
' move pgup pgdn ',
' with home end ctr ');
Menu : Array[1..20] of String[23] =
('┌─────────────────────┐',
'│ BConfig 1.2 │',
'│BDEBUG config utility│',
'│ copyright (C) 1989 │',
'│ Jeff Bowles │',
'├─────────────────────┤',
'│ │',
'│ Menu position │',
'│ Window position │',
'│ Window size │',
'│ │',
'│ Clone BDEBUG │',
'│ Menu Color │',
'│ Selection Bar Color │',
'│ Window Color │',
'│ Exit this menu (ESC)│',
'├─────────────────────┤',
'│ Use to move bar. │',
'│ │',
'└─────────────────────┘');
Bwindow : Array[1..22] of string[80] =
('Operation -: BConfig 1.2 ┌Key Value─┬─────────────────────────────┐',
' -:BDEBUG config │..........│.............................│',
'Record Length-:(C) J. Bowles │..........│.............................│',
'Key No. -: │..........│.............................│',
'Key Length -: move with │..........│.............................│',
' -: pgup pgdn │..........│.............................│',
'Status -: home end ctr │..........│.............................│',
' -: │..........│.............................│',
' Hit Any Key To Continue └──────────┴─────────────────────────────┘',
'┌Record Buffer Value┬────────────────────────────────────────────────────────┐',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'│...................│........................................................│',
'└───────────────────┴────────────────────────────────────────────────────────┘');
BPatch : Array[1..40] of byte =
($53,$51,$52,$57,$56,$1e,$06, {PUSH several regs }
$bb,$01,$00, {mov bx,speedword }
$b4,$01, {mov ah,01 }
$cd,$16, {int 16h, scan keyboard }
$75,$0e, {jnz , if key pressed }
$4b, {dec bx }
$75,$f7, {jnz , loop if not zero }
{gohome}
$07,$1f,$5e,$5f,$5a,$59,$5b, {POP all PUSHed regs }
$e9,$90,$27, {jmp 380Ch, go BDEBUG }
$90, {NOP }
$b4,$00, {mov ah,0 }
$cd,$16, {int 16h, flush keybd }
$b4,$00, {mov ah,0 }
$cd,$16, {int 16h, wait for key }
$eb,$eb); {jmp gohome, go BDEBUG }
{$IfDef UseSysReq}
SysPatch : Array[1..18] of byte = (
$1E, {push ds}
$50, {push ax}
$31,$C0, {xor ax,ax}
$8E,$D8, {mov ds,ax}
$A0,$18,$04, {mov al,[$0418]}
$24,$04, {and al,$04}
$3C,$04, {cmp al,$04}
$58, {pop ax}
$1F, {pop ds}
$E9,$D1,$2A); {jmp $3B6A}
GoSysPatch : Array[1..4] of byte = ($e9,$22,$d5, {jmp $0f87 }
$90); {NOP }
{$EndIf}
NoSysPatch : Array[1..4] of byte = ($b4,$02, {mov ah,02 }
$cd,$16); {int 16h }
AnimatePatch : Array[1..4] of byte = ($e9,$53,$d8, {jmp 0F5Fh }
$90); {NOP }
NormalPatch : Array[1..4] of byte = ($b4,$00, {mov ah,0 }
$cd,$16); {int 16h }
Sel : integer = 0;
var
CloneFile : File of Byte;
StrkMode : StrikeMode;
Wake,WasIn8x8 : Boolean;
AnimateFactor, {00-99, translates to 0-$FFFF }
WPosX,WPosY,
MPosX,MPosY,
WHeight,WWidth,
MHeight,MWidth,
MenuColor, HiColor,
WindowColor : Byte;
MenuBufPtr : WindowPtr;
BufPtr : WindowPtr; {used in TPWindow routines }
Scr : Pointer; {used to save original screen }
Ch,XY,ScanLines : Word; {used to save original cursor }
FullName : String;
Procedure SoundBlip(HZ : Integer);
Begin
{$IfNDef Quiet}
sound(HZ);
delay(50);
nosound;
{$EndIf}
End;
Procedure MaybeBlip(CH : Word);
begin
if (CH = $011B) or (CH = $1C0D) then
{}
else
SoundBlip(500);
end;
Procedure ShowToggles;
Var Temp : String;
Begin
if Wake then
FastWrite(' Wake up ',TopRow+6,LeftCol+1,MenuColor)
else
FastWrite(' Sleep ',TopRow+6,LeftCol+1,MenuColor);
Case StrkMode of
Single: FastWrite(' Single Strike ',TopRow+10,LeftCol+1,MenuColor);
Double: FastWrite(' Double Strike ',TopRow+10,LeftCol+1,MenuColor);
Animate: begin
FastWrite(' Animate '+arrows,TopRow+10,LeftCol+1,MenuColor);
Str(AnimateFactor,Temp);
Temp := LeftPadCH(Temp,'0',2);
If Sel=4 then
FastWrite('A'+Temp,TopRow+10,LeftCol+13,HiColor)
else
FastWrite('A'+Temp,TopRow+10,LeftCol+13,MenuColor);
end;
end;
End;
Procedure MenuBar (Hilite : boolean);
Begin
Case sel of
0,4 :
FastWrite(' Hit enter to toggle.',TopRow+18,LeftCol+1,HiColor);
6,7,8 :
FastWrite(' F5 ForeGr F6 BackGr.',TopRow+18,LeftCol+1,HiColor);
else
FastWrite(' Hit enter to select.',TopRow+18,LeftCol+1,HiColor);
end;
if Hilite = True then
ChangeAttribute(21,TopRow+6+sel,LeftCol+1,HiColor)
else
ChangeAttribute(21,TopRow+6+sel,LeftCol+1,MenuColor);
End;
Procedure ShowWindow;
var X:integer;
Begin
if not DisplayWindow(BufPtr) then {};
HiddenCursor;
For x := 1 to Wheight-2 do
FastWriteClip(bwindow[x],x,1,WindowColor);
End;
Procedure ShowMenuWindow;
var X:integer;
Begin
With WindowP(MenuBufPtr)^ do
begin
Draw.FAttr := MenuColor;
DisplayedOnce := False;
end;
if not DisplayWindow(MenuBufPtr) then runerror(99);
HiddenCursor;
For x := 1 to Mheight-2 do
FastWriteClip(OldMenu[x],x,1,MenuColor);
End;
Procedure ShowMenu(ReadKbd : boolean); forward;
Procedure WindowSize; {uses TPWindow routines to shrink/grow a window }
var ch : word;
Begin
Ch := 0;
While not (EraseTopWindow = nil) do;
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowWindow;
Repeat
Ch := ReadKeyWord;
case Ch of
$4b00 : if WWidth > $1f then {left}
if ResizeWindow(-1,0,' ') then dec(WWidth);
$4d00 : if ResizeWindow(1,0,' ') then inc(WWidth); {right}
$4800 : if WHeight > $0b then {up}
If ResizeWindow(0,-1,' ') then Dec(WHeight);
$4700 : if (WHeight > $0b) and (WWidth >$22) then {home}
If ResizeWindow(-3,-1,' ') then begin
Dec(WHeight);
Dec(WWidth,3);
end;
$4c00 : If MoveWindow( {center 5}
((80-WWidth) div 2)-WPosX,
((24-WHeight) div 2)-WPosY)
then begin
WPosX := (80-WWidth) div 2;
WPosY := (24-WHeight) div 2;
end;
$5000 : if (WHeight+WPosY < 24) then {down}
if ResizeWindow(0,1,' ') then Inc(WHeight);
$5100 : if (WHeight+WPosY < 24) and (WWidth < 80) then {pg down}
if ResizeWindow(3,1,' ') then begin
Inc(WHeight);
Inc(WWidth,3);
end;
else
MaybeBlip(CH);
End;
ShowWindow;
until (ch = $011b) or (ch = $1c0d) ; {esc or enter}
if (EraseTopWindow=nil) then {};
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowMenu(True);
ShowToggles;
End;
Procedure WindowPos; {Uses TPWindow routines to move a window}
var ch : word;
Begin
Ch := 0;
if not (EraseTopWindow = nil) then {};
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowWindow;
Repeat
Ch := ReadKeyWord;
case Ch of
$4700 : If MoveWindow(-3,-1) then begin {home}
Dec(WPosX,3);
Dec(WPosY);
end;
$4800 : If MoveWindow(0,-1) then dec(WPosY); {up}
$4900 : If MoveWindow(3,-1) then begin {pg up}
Inc(WPosX,3);
Dec(WPosY);
End;
$4b00 : if MoveWindow(-1,0) then dec(WPosX); {left}
$4c00 : If MoveWindow( {center 5}
((80-WWidth) div 2)-WPosX,
((24-WHeight) div 2)-WPosY)
then begin
WPosX := (80-WWidth) div 2;
WPosY := (24-WHeight) div 2;
end;
$4d00 : If MoveWindow(1,0) then inc(WPosX); {right}
$4f00 : If ((WPosY+WHeight) < 24) and {end}
MoveWindow(-3,1) then begin
Dec(WPosX,3);
Inc(WPosY);
end;
$5000 : If (WPosY+Wheight) < 24 then {down}
If MoveWindow(0,1) then inc(WPosY);
$5100 : If ((WPosY+WHeight) <24) and {pg down}
MoveWindow(3,1) then begin
Inc(WPosX,3);
Inc(WPosY);
end;
else
MaybeBlip(CH);
End;
until (ch = $011b) or (ch = $1c0d) ; {esc or enter}
if (EraseTopWindow=nil) then {};
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowMenu(True);
ShowToggles;
End;
Procedure MenuPos; {Uses TPWindow routines to move a window}
var ch : word;
Begin
Ch := 0;
if not (EraseTopWindow = nil) then runerror(98);{};
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowMenuWindow;
Repeat
Ch := ReadKeyWord;
case Ch of
$4700 : If MoveWindow(-3,-1) then begin {home}
Dec(MPosX,3);
Dec(MPosY);
end;
$4800 : If MoveWindow(0,-1) then dec(MPosY); {up}
$4900 : If MoveWindow(3,-1) then begin {pg up}
Inc(MPosX,3);
Dec(MPosY);
End;
$4b00 : if MoveWindow(-1,0) then dec(MPosX); {left}
$4c00 : If MoveWindow( {center 5}
((80-MWidth) div 2)-MPosX,
((24-MHeight) div 2)-MPosY)
then begin
MPosX := (80-MWidth) div 2;
MPosY := (24-MHeight) div 2;
end;
$4d00 : If MoveWindow(1,0) then inc(MPosX); {right}
$4f00 : If ((MPosY+MHeight) < 24) and {end}
MoveWindow(-3,1) then begin
Dec(MPosX,3);
Inc(MPosY);
end;
$5000 : If (MPosY+Mheight) < 24 then {down}
If MoveWindow(0,1) then inc(MPosY);
$5100 : If ((MPosY+MHeight) <24) and {pg down}
MoveWindow(3,1) then begin
Inc(MPosX,3);
Inc(MPosY);
end;
Else
MaybeBlip(CH);
End;
until (ch = $011b) or (ch = $1c0d) ; {esc or enter}
if (EraseTopWindow=nil) then {};
RestoreWindow(1,1,ScreenWidth,ScreenHeight,False,Scr);
ShowMenu(True);
ShowToggles;
End;
Procedure HeyYou;
Begin
FastWrite(' F5 ForeGr F6 BackGr.',TopRow+18,LeftCol+1,(HiColor or $80));
SoundBlip(500);
Delay(1500);
FastWrite(' F5 ForeGr F6 BackGr.',TopRow+18,LeftCol+1,HiColor);
End;
Procedure Clone;
const
Fname : string = 'BDEBUG.COM';
var
temp : byte;
tempstr : string;
tempstr2: string;
TempWord : Word;
TempArr : Array[0..1] of byte absolute TempWord;
Procedure WriteArray(Addr : word; Var A; Elements : byte);
{local procedure to copy an array to a file at a given offset}
Var Offset : byte;
B : array[1..255] of byte absolute A;
begin
Seek(CloneFile,Addr);
For Offset := 1 to Elements do
Write(CloneFile,B[Offset]);
end;
Begin
FastWrite(' *** Now Cloning *** ',TopRow+11,LeftCol+1,MenuColor);
MenuBar (True);
SoundBlip(2000);
Assign(CloneFile,fullname);
Reset(CloneFile);
{Write animation patch, including user defined speed}
If AnimateFactor = 0 then begin {speed 0 is really set to 0001 to }
BPatch[9]:=1; {prevent counter flipping back to $FFFF}
BPatch[10]:=0;
end
else begin
BPatch[9]:=Lo(AnimateFactor * Factor); {mult * Factor to scale 99 up}
BPatch[10]:=Hi(AnimateFactor * Factor); {to $FFFF, 50 to $8000, etc. }
end;
WriteArray($0f5f,BPatch,SizeOf(BPatch));
{Write Position, Size, Mode info}
Seek(CloneFile,$127f);
Write(CloneFile,WPosY);
Write(CloneFile,WPosX);
Write(CloneFile,WHeight);
Write(CloneFile,WWidth);
Temp := ord(StrkMode);
If Temp = 2 then temp :=0; {if animate, assume single strike mode}
Write(CloneFile,Temp);
Seek(CloneFile,$26d5);
Temp := ord(Wake);
Write(cloneFile,Temp);
(*********************************************************************)
{$IfDef UseSysReq}
WriteArray($0f87,SysPatch,SizeOf(SysPatch));
WriteArray($3a62,GoSysPatch,SizeOf(GoSysPatch));
WriteArray($3ee8,SysString[1],Length(SysString));
{$Else}
WriteArray($3a62,NoSysPatch,SizeOf(NoSysPatch));
WriteArray($3ee8,NoSysString[1],Length(NoSysString));
{$EndIf}
(*********************************************************************)
{Write either 'Jump to Animate' patch or 'Normal' patch instructions}
If StrkMode = Animate then
begin
WriteArray($3709,AnimatePatch,SizeOf(AnimatePatch));
TempStr :='A'+LeftPadCh(Long2Str(AnimateFactor),'0',2);
TempStr2:='Animate ('+LeftPadCh(Long2Str(AnimateFactor),'0',2)+')';
WriteArray($0174,TempStr [1],Length(TempStr)); {write 'Axx' string}
WriteArray($018b,TempStr [1],Length(TempStr)); { " " " }
WriteArray($01dd,TempStr2[1],Length(TempStr2)); { " " " }
end
else
begin
WriteArray($3709,NormalPatch,SizeOf(NormalPatch));
TempStr := ' ';
TempStr2:= ' ';
WriteArray($0174,TempStr[1],Length(TempStr)); {erase 'Axx' string}
WriteArray($018b,TempStr[1],Length(TempStr)); {erase 'Axx' string}
WriteArray($01dd,TempStr2[1],Length(TempStr2)); {erase 'Axx' string}
end;
Seek(clonefile,$3ea2);
Temp := $fd;
Write(clonefile,Temp); {put the ² in BDEBUG²}
Seek(CloneFile,$3A18);
Write(CloneFile,WindowColor);
Seek(CloneFile,$3ADB);
TempWord := Word(MPosY-1)*80*2 + Word(MPosX-1)*2;
Write(CloneFile,TempArr[0]);
Write(CloneFile,TempArr[1]);
Inc(TempWord,$A2);
Seek(CloneFile,$3D18);
Write(CloneFile,TempArr[0]);
Write(CloneFile,TempArr[1]);
Seek(CloneFile,$3CFB);
Write(CloneFile,MenuColor);
Seek(CloneFile,$3D2E);
Write(CloneFile,HiColor);
Close(CloneFile);
SoundBlip(2000);
FastWrite(' Clone BDEBUG ',TopRow+11,LeftCol+1,MenuColor);
MenuBar (True);
End;
Procedure Select;
Begin
Case Sel of
0 : Begin {toggle wake/sleep state}
Wake := Not(Wake);
ShowToggles;
MenuBar (True);
End;
1 : MenuPos;
2 : WindowPos; {adjust window position}
3 : WindowSize; {adjust window size}
4 : Begin {cycle single/double/animate}
If StrkMode=Animate then
StrkMode := Single
Else
StrkMode := Succ(StrkMode);
Showtoggles;
MenuBar (True);
End;
5 : Clone; {write patches to BDEBUG}
6,7,8 : HeyYou; {Yell at user, use F7-F8 instead}
9 : Ch := $011b; {same as ESC, quit}
End;
End;
Procedure SetFG( Var Kolor : Byte);
var f : byte;
begin
case CurrentMode of
2,7 : begin
Case Kolor of
$07,$87 : Inc(Kolor,$69);
$70,$F0 : Inc(Kolor,$17);
end;
end
else
begin
f := (Kolor and $0F);
inc(f);
if f > 15 then f:=0;
Kolor := ((Kolor and $F0) or f);
end;
end;
ShowMenu(False);
end;
Procedure SetBG( Var Kolor : Byte);
var B : byte;
begin
case CurrentMode of
2,7 : begin
Case Kolor of
$07,$87 : Inc(Kolor,$69);
$70,$F0 : Inc(Kolor,$17);
end;
end
else
begin
B := Kolor SHR 4;
inc(B);
if B > 7 then b := 0;
Kolor := ((Kolor and $0F) or (B SHL 4));
end;
end;
ShowMenu(False);
End;
Procedure ShowMenu(ReadKbd : Boolean);
var x, terminal : byte;
{local procedure to display relative animation speed}
Procedure ShowFactor;
Var Temp : String;
Begin
Str(AnimateFactor,Temp);
If Length(Temp)<2 then Temp := '0' + Temp;
FastWrite('A'+Temp,TopRow+10,LeftCol+13,HiColor);
end;
Begin
HiddenCursor;
if ReadKbd then Terminal := 20 else Terminal := 6;
for x:=1 to Terminal do
begin
FastWrite(Menu[x],TopRow-1+x,LeftCol,MenuColor);
If (x>1) and (x<6) then
ChangeAttribute(21,TopRow-1+x,LeftCol+1,WindowColor);
end;
showtoggles;
MenuBar (True);
If Not ReadKbd then Exit;
Ch := 0;
Repeat
Ch := ReadKeyWord;
case Ch of
$1c0d : Select; {enter}
$4b00 : if (sel=4) and (StrkMode = Animate) then begin {left}
If AnimateFactor > 0 then
Dec(AnimateFactor)
else
AnimateFactor := 99;
ShowFactor;
end;
$4d00 : if (sel=4) and (StrkMode = Animate) then begin {right}
If AnimateFactor < 99 then
Inc(AnimateFactor)
else
AnimateFactor := 00;
ShowFactor;
end;
$4800 : Begin {up}
MenuBar (False);
dec(sel);
if sel<0 then sel := 9;
MenuBar (True);
End;
$5000 : Begin {down}
MenuBar (False);
inc(sel);
if sel>9 then sel := 0;
MenuBar (True);
End;
$3f00 : begin {F5 set foreground color}
Case Sel of
6: Begin
SetFG(MenuColor);
ShowMenu(True);
end;
7: Begin
SetFG(HiColor);
MenuBar(True);
With WindowP(BufPtr)^ do
begin
Draw.HAttr := HiColor;
DisplayedOnce := False;
end;
end;
8: Begin
SetFG(WindowColor);
ShowMenu(False);
With WindowP(BufPtr)^ do
begin
Draw.FAttr := WindowColor;
Draw.WAttr :=WindowColor;
DisplayedOnce := False;
end;
End;
else
MaybeBlip(CH);
end;
end;
$4000 : begin {F6 set background color}
Case Sel of
6: Begin
SetBG(MenuColor);
ShowMenu(True);
End;
7: Begin
SetBG(HiColor);
MenuBar(True);
With WindowP(BufPtr)^ do
begin
Draw.HAttr := HiColor;
DisplayedOnce := False;
end;
End;
8: Begin
SetBG(WindowColor);
ShowMenu(False);
With WindowP(BufPtr)^ do
begin
Draw.FAttr := WindowColor;
Draw.WAttr := WindowColor;
DisplayedOnce := False;
end;
End;
else
MaybeBlip(CH);
end;
end
else
MaybeBlip(CH);
End;
until ch = $011b; {esc}
NormalCursor;
End;
Procedure Initialize;
Begin
GetCursorState(XY,ScanLines);
Explode:= true;
ExplodeDelay := 5;
{$IfDef Quiet}
SoundFlagW := False;
{$EndIf}
SetFrameChars(#186,#205,#188,#187,#200,#201);
MWidth:=23;
MHeight:=11;
End;
Procedure ReadCloneFile;
const
Fname : string = 'BDEBUG.COM';
var
temp : byte;
PosLo : byte;
PosHi : byte;
tempword : word;
Begin
if Not ExistOnPath(Fname,fullname) then
Begin
Writeln('Cannot find ',fname,' on search path.');
Halt(1);
End;
Assign(CloneFile,fullname);
Reset(CloneFile);
Seek(CloneFile,$0f5f+8); {find speed factor in BDEBUG.COM}
Read(CloneFile,Temp); {read lo byte }
Read(CloneFile,AnimateFactor); {read hi byte }
AnimateFactor :=
(AnimateFactor*256 + Temp) Div Factor; {scale down to 0-99 range }
Seek(CloneFile,$127f);
Read(CloneFile,WPosY);
Read(CloneFile,WPosX);
Read(CloneFile,WHeight);
Read(CloneFile,WWidth);
Read(CloneFile,Temp);
If Temp = 0 then
StrkMode := Single
else
StrkMode := Double;
Seek(CloneFile,$0174);
Read(CloneFile,temp); {look for 'Axx' string }
If temp = 65 then
StrkMode := Animate; {found, must be in Animate mode}
Seek(CloneFile,$26d5);
Read(CloneFile,Temp);
Wake := (Temp = 1); {convert BDEBUG 0-1 to boolean }
Seek(CloneFile,$3A18);
Read(CloneFile,WindowColor);
Seek(CloneFile,$3ADB);
Read(CloneFile,PosLo);
Read(CloneFile,PosHi);
TempWord := Word(PosHi)*256+PosLo;
MPosY := (TempWord div (80*2)) + 1;
MPosX := ((TempWord - (( MPosY-1) *80*2)) div 2) + 1;
LeftCol := MPosX;
Seek(CloneFile,$3CFB);
Read(CloneFile,MenuColor);
Seek(CloneFile,$3D2E);
Read(CloneFile,HiColor);
Close(CloneFile);
case CurrentMode of
2, {BW80}
7 : {MONOCHROME}
begin
WindowColor := $07; {white on black}
MenuColor := $07; {white on black}
HiColor := $70; {black on white}
end;
end;
End;
Begin {main}
Initialize; {set up defaults, define TPWindow variables}
ReadCloneFile; {load current states from BDEBUG.COM }
if SaveWindow(1,1,ScreenWidth,ScreenHeight,True,Scr) then
begin
If Font8x8Selected then
begin
SelectFont8x8(False);
WasIn8x8 := True;
end
else
WasIn8x8 := False;
If MakeWindow(MenuBufPtr,MPosX,MPosY,MPosX+MWidth-1,
MPosY+MHeight-1,True,True,True,MenuColor,
MenuColor,HiColor,'Sample Menu') then {};
If MakeWindow(BufPtr,WPosX+1,WPosY+1,WPosX+WWidth,
WPosY+WHeight,True,True,True,WindowColor,
WindowColor,HiColor,' Sample Window ') then ShowMenu(True);
RestoreWindow(1,1,ScreenWidth,ScreenHeight,True,Scr);
RestoreCursorState(XY,ScanLines);
If WasIn8x8 then SelectFont8x8(True);
end;
End.